package com.lry.basic.aop.cglib.classs;


import com.lry.basic.aop.cglib.interfaces.UserMapper;

import java.lang.reflect.Proxy;

public class UserService {

    @Tran
    int select(){
        UserMapper userMapper=(UserMapper) Proxy.newProxyInstance(UserMapper.class.getClassLoader(),
                new Class[]{UserMapper.class}, new UserMapperInvocationHandler());

        int select = userMapper.select();
        System.out.println("查出来的数据："+select);

        select2();
        return select;
    }

    @Tran
    int select2(){
        return 1;
    }


    //final不会被增强
    @Tran
    final int finalSelect1(){
        return 1;
    }


}
